#include "BDTestFactory.h"
#include "BDTest_1.hpp"
#include "BDTest_2.hpp"
#include "BDTest_3.hpp"
#include "BDTest_4.hpp"
#include "BDTest_5.hpp"
#include "BDTest_6.hpp"
#include "BDTest_7.hpp"
#include "BDTest_8.hpp"
#include "BDTest_9.hpp"

BDTestFactory* BDTestFactory::m_pInstance = NULL;

BDTestFactory::BDTestFactory()
{
}


BDTestFactory::~BDTestFactory()
{
}

BDTestFactory* BDTestFactory::GetInstance()
{
	if (m_pInstance == NULL) {
		m_pInstance = new BDTestFactory;
	}
	return m_pInstance;
}

void BDTestFactory::Destory()
{
	if (m_pInstance == NULL) {
		return;
	}
	delete m_pInstance;
	m_pInstance = NULL;
}

TFTest* BDTestFactory::NewTest(int i)
{
	switch (static_cast<Test>(i))
	{
	case TEST_1:
		return new Test_1;
	case TEST_2:
		return new Test_2;
	case TEST_3:
		return new Test_3;
	case TEST_4:
		return new Test_4;
	case TEST_5:
		return new Test_5;
	case TEST_6:
		return new Test_6;
	case TEST_7:
		return new Test_7;
	case TEST_8:
		return new Test_8;
	case TEST_9:
		return new Test_9;
	default:
		return NULL;
	}
}

int BDTestFactory::GetTestCount()
{
	return static_cast<int>(TEST_MAX);
}